<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class page2_css_list_model extends Model
{
	var $url_prefix = 'admin/page2_css.page2_css.lists';
	var $url_prefix2 = 'admin/page2_css.page2_css.detail';
	var $start_segment = 3;
	var $start;
	var $msg_cache_prefix = 'msg';
	var $filter_cache_prefix = 'filter';
	var $cache;
	var $cache_name = 'page2_css';
	var $columns = array();
	var $item_segment = 4;
	var $error_string = '';
	
	function page2_css_list_model()
	{
		parent::Model();
		
		global $CI;
		$start = $CI->uri->segment($this->start_segment);
		$this->start = $start?$start:0;
		
		$this->cache = new Session_lite($this->cache_name);
		
		$this->columns = array(
			'id'=>PAGE_CSS.'.'.PAGE_CSS_PAGE_CSS_ID,
			'css_file'=>PAGE_CSS.'.'.PAGE_CSS_CSS_FILE,
			'note'=>PAGE_CSS.'.'.PAGE_CSS_NOTE,
		);
	}
	
	function admin_id()
	{
        return '1'; //Luan : themes manager move to super admin, means all franchisee use same themes
		global $CI;
		$a = $CI->session->userdata('admin_auth_logged');
		return $a['admin_id'];
	}

	function check_delete($id)
	{	
		global $CI;
		/*$q = $CI->db->get_where(PAGE_CSS, array(PAGE_CSS_PAGE_CSS_ID=>$id));	
		$row = $q->row();
		if (!$row)
			return true;
		
		$q = $CI->db->get_where(PAGE, array(PAGE_CSS_FILE=>$row->{PAGE_CSS_CSS_FILE}));
		if ($q->num_rows())
		{
			$this->error_string = "Dependency Error! There is a page for this theme (#{$id}). Please remove it firstly.";
			return false;
		}*/
		return true;
	}
}

?>
